<template>
	<view class="box">
		<view class="none" v-if="!list.length">
			<view class="none-img f-w">
				<image src="https://jw.xzsw2021.com/static/big/icon_268@2x.png" mode=""></image>
			</view>
			<view class="none-name c666">暂时没有分享任何人哦~</view>
			<view class="none-btn" @click="goShare">分享二维码</view>
		</view>
		<view class="list" v-else>
			<view class="card flex" v-for="(item,index) of list" :key="index">
				<view class="img f-w">
					<image :src="item.avatar" mode=""></image>
				</view>
				<view class="right">
					<view class="one fw-bt">
						<view class="f26">{{item.nickname}}</view>
						<!-- <view class="f30 red">￥{{item.pay_price}}</view> -->
						<view class="f30 red">￥{{item.MyExtensionOneSum}}</view>
					</view>
					<view class="two fw-bt f22 c666">
						<view>{{item.mobile}}</view>
						<view>{{item.desc}}</view>
					</view>
					<view class="three fw-bt c999 f22">{{item.spread_time}}</view>
				</view>
			</view>
			<view class="no c999 f22 tr">没有更多了哦~</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				page: 1,
				list: [], //
			}
		},
		onLoad() {
			this.getlist(this.page)
		},
		onReachBottom() {
			this.getlist(this.page + 1)
		},
		methods: {
			// 分享二维码
			goShare() {
				uni.navigateTo({
					url: '/pages/user/distribution/code'
				})
			},
			getlist(e) {
				this.$request(`user/spread_list?page=${e}&limit=20&keyword=&level=1&sort`, {}, 'GET').then(res => {
		
					if (res.status == 200) {
						if (e == 1) {
							this.list = res.data.list
						} else {
							if (res.data.list.length == 0) {
								uni.showToast({
									title: "暂无更多",
									icon: "none"
								})
								return
							}
							let list = this.list
							list = [...list, ...res.data.list]
							this.list = list
							this.page = e
						}
					}
				})

			},

		}
	}
</script>

<style lang="scss" scoped>
	.box {
		.none {
			text-align: center;

			.none-img {
				margin: 95rpx auto 80rpx;
				width: 377rpx;
				height: 305rpx;

				image {
					width: 100%;
					height: 100%;
				}
			}

			.none-desc {
				margin-top: 20rpx;
			}

			.none-btn {
				margin: 70rpx auto 0;
				width: 300rpx;
				height: 100rpx;
				line-height: 100rpx;
				text-align: center;
				font-size: 32rpx;
				color: #fff;
				background: linear-gradient(64deg, #2BCCA5, #22B591);
				box-shadow: 0rpx 4rpx 6rpx 0rpx rgba(20, 187, 146, 0.4);
				border-radius: 10rpx;
			}
		}

		.no {
			padding: 30rpx;
		}

		.list {
			overflow: hidden;
			padding: 0 30rpx;

			.card {
				padding: 30rpx 0;
				background: #FFFFFF;
				border-bottom: 1rpx solid #eee;

				.img {
					flex-shrink: 0;
					width: 86rpx;
					height: 86rpx;

					image {
						width: 100%;
						height: 100%;
						border-radius: 50%;
					}
				}

				.right {
					margin-left: 24rpx;
					flex: 1;

					.two {
						margin: 12rpx 0;
					}
				}
			}
		}
	}
</style>
